home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / FREENET / CROFT / GROUPS02 / !Groups / GrabList (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1995-07-10  |  1KB  |  45 lines

  1.  >GrabList
  2.  Grabs a newsgroups list from an NNTP server
  3.  David Croft, 1995
  4. *RMEnsure Internet 0.00 Error 0 You need a TCP/IP protocol stack (such as FreeNet or Acorn TCP/IP) to grab the newsgroups list.
  5. "GrabList 0.01dummy    
  6.  David Croft, 1995"
  7.  "OS_GetEnv" 
  8.  com$
  9. temp%=
  10. com$," -o ")
  11.  temp%=0 
  12. "Syntax: GrabList -o <output filename>":
  13. file$=
  14. com$,temp%+4)
  15.  "Output filename: ";file$
  16.  ''"Enter the hostname or IP address of the news server you want to"'"connect to. (Demon users could use news.demon.co.uk)"'
  17.  "NNTP server: "server$
  18. (server$)=0 
  19.  "XOS_SWINumberFromString",,"Internet_GetHostByName" 
  20.  swi%;flags%
  21.  (flags% 
  22.  1)=1 
  23.  swi%=0 
  24. '"You cannot specify by hostname if you do not have InetDB."'"Use an IP address instead.":
  25.  Lookup using InetDB
  26.  "Internet_GetHostByName",0,server$ 
  27.  ,hostent%
  28.  hostent%=0 
  29. "No host found!"
  30.  hostent%?20
  31.  hostent%?21
  32.  hostent%?22
  33.  hostent%?23
  34. "Initialising connection."
  35. "(The rest of the procedure has not been completed)"
  36. string(st,ptr)
  37. st$=""
  38.  (st?ptr)>=32 
  39. (st$)<255
  40.  st$+=
  41. (st?ptr)
  42.  ptr+=1
  43. '"(Program terminated)"
  44. 3    *quit
  45.